import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/page/Login' //登录
import Login2 from '@/components/page/Login2' //登录2
import SetTime from '@/components/page/SetTime' //设置 时间
import SetType from '@/components/page/SetType' //设置 类型
import SetPlace from '@/components/page/SetPlace' //设置 关注地点
import SetBanner from '@/components/page/SetBanner' //设置 banner图
import SetReason from '@/components/page/SetReason' //设置 请假原因
import ApplyManage from '@/components/page/ApplyManage' //申请管理
import ApplyDetail from '@/components/page/ApplyDetail' //详情
import Dashboard from '@/components/page/Dashboard' //Dashboard 统计
import Dashboard1 from '@/components/page/Dashboard1' //Dashboard 统计
import Home from '@/components/common/Home' //Home 根组件
import Manager from '@/components/page/Manager' //Manager 管理员
import Department from '@/components/page/Department' //Department 部门
import Test from '@/components/page/Upload' //测试组件

Vue.use(Router)

export default new Router({
	mode: 'history',
	routes: [{
			path: '',
			redirect: {
				name: "Dashboard1"
			}
		}, {
			path: '/',
			redirect: {
				name: "Dashboard1"
			}
		},
		{
			path: '/index',
			redirect: {
				name: "Dashboard1"
			}
		},
		{
			path: '/login',
			name: 'Login',
			component: Login
		},
		{
			path: '/login2',
			name: 'Login2',
			component: Login2
		},
		{
			path: '/home',
			component: Home,
			meta: {
				title: 'Home'
			},
			children: [{
					path: '/dashboard',
					name: 'Dashboard',
					component: Dashboard,
					meta: {
						title: '首页',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/dashboard1',
					name: 'Dashboard1',
					component: Dashboard1,
					meta: {
						title: '首页',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/applymanage',
					name: 'ApplyManage',
					component: ApplyManage,
					meta: {
						title: '请销假管理',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/applydetail',
					name: 'ApplyDetail',
					component: ApplyDetail,
					meta: {
						title: '申请详情',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/manager',
					name: 'Manager',
					component: Manager,
					meta: {
						title: '操作员管理',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/department',
					name: 'Department',
					component: Department,
					meta: {
						title: '院系管理',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/settime',
					name: 'SetTime',
					component: SetTime,
					meta: {
						title: '时间配置',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/settype',
					name: 'SetType',
					component: SetType,
					meta: {
						title: '请假类型配置',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/setreason',
					name: 'SetReason',
					component: SetReason,
					meta: {
						title: '请假原因配置',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/setplace',
					name: 'SetPlace',
					component: SetPlace,
					meta: {
						title: '关注地点',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/setbanner',
					name: 'SetBanner',
					component: SetBanner,
					meta: {
						title: '设置banner',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
				{
					path: '/test',
					name: 'Test',
					component: Test,
					meta: {
						title: '关注地点',
						isLogin: true // 添加该字段，表示进入这个路由是需要登录的
					}
				},
			]
		},
	]
})
